home *** CD-ROM | disk | FTP | other *** search
/ Corel Professional Photos 116: France / Corel Professional Photos - 1994 - 116 - France.ISO / utils / setup / corelcd.mst < prev    next >
Text File  |  1993-09-23  |  23KB  |  773 lines

  1. '**************************************************************************
  2. '*           MSSetup Toolkit - Corel Professional Photos Setup            *
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. CONST WS_VISIBLE=&H10000000
  11. CONST WS_BORDER =&H00800000
  12. CONST WS_CLIPCHILDREN =&H02000000
  13. CONST GWL_STYLE =-16
  14. CONST SW_SHOWMAXIMIZED=3
  15.  
  16. DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER
  17. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%,offset%,style&) AS LONG
  18.  
  19. hWnd%=HwndFrame()
  20.  
  21. sti&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
  22. stj%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
  23.  
  24. ''Dialog ID's
  25. CONST WELCOME      = 100
  26. CONST ASKQUIT      = 200
  27. CONST DESTPATH     = 300
  28. CONST EXITFAILURE  = 400
  29. CONST EXITQUIT     = 600
  30. CONST EXITSUCCESS  = 700
  31. CONST APPHELP      = 900
  32. CONST CUSTINST     = 6200
  33. CONST TOOBIG       = 6300
  34. CONST BADPATH      = 6400
  35. CONST MOSAIC       = 7100
  36. CONST PCDSCSI      = 7200
  37. CONST CDAUDIO      = 7300
  38.  
  39. ''Bitmap ID
  40. CONST LOGO         = 1
  41.  
  42. ''File Types
  43. CONST PCDLABFILES    = 1
  44. CONST PCDMOSFILES    = 2
  45. CONST PCDAUDFILES    = 3
  46. CONST PCDSCRFILES    = 4
  47. CONST PCDWALFILES    = 5
  48.  
  49. GLOBAL DEST$        ''Default destination directory.
  50. GLOBAL WINDRIVE$    ''Windows drive letter.
  51. GLOBAL OPT1OPT$     ''Option selection from OptFiles1 option dialog.
  52. GLOBAL OPT2OPT$     ''Option selection from OptFiles2 option dialog.
  53. GLOBAL OPT3OPT$     ''Option selection from OptFiles3 option dialog.
  54. GLOBAL OPT4OPT$     ''Option selection from OptFiles4 option dialog.
  55. GLOBAL MosDir$      ''Location of old mosaic program, if found.
  56. GLOBAL MosFlag$      ''Flag for old mosaic program, if found.
  57.  
  58. FLAG1$          ="No"      '' Copy flags for
  59. FLAG2$          ="No"      '' DLL files that go
  60. FLAG3$          ="No"      '' into WindowsDir and WindowsSysDir
  61.  
  62. ''CustInst list symbol names
  63. GLOBAL PCDLABNEEDS$    ''Option list costs per drive
  64. GLOBAL PCDMOSNEEDS$
  65. GLOBAL PCDAUDNEEDS$
  66. GLOBAL PCDSCRNEEDS$
  67. GLOBAL PCDWALNEEDS$
  68.  
  69. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  70. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  71.  
  72. ''Dialog list symbol names
  73. GLOBAL CHECKSTATES$
  74. GLOBAL STATUSTEXT$
  75. GLOBAL DRIVETEXT$
  76.  
  77.  
  78. DECLARE SUB AddOptFilesToCopyList (ftype%)
  79. DECLARE SUB RecalcOptFiles (ftype%)
  80. DECLARE SUB RecalcPath
  81. DECLARE SUB SetDriveStatus
  82. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  83.  
  84.  
  85.  
  86. INIT:
  87.     CUIDLL$ = "mscuistf.dll"            ''custom user interface dll
  88.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  89.  
  90.     SetBitmap CUIDLL$, LOGO
  91.     SetTitle "Corel Professional Photos Setup"
  92.  
  93.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  94.     IF szInf$ = "" THEN
  95.     szInf$ = GetSymbolValue("STF_CWDDIR") + "CORELCD.INF"
  96.     END IF
  97.     ReadInfFile szInf$
  98.  
  99.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  100.     WINDIR$ = GetWindowsDir()
  101.     DEST$ = WINDRIVE$ + ":\CORELCD"
  102.  
  103.     ''CustInst list symbols
  104.     CHECKSTATES$ = "CheckItemsState"
  105.     STATUSTEXT$  = "StatusItemsText"
  106.     DRIVETEXT$   = "DriveStatusText"
  107.     FOR i% = 1 TO 8 STEP 1
  108.     AddListItem CHECKSTATES$, "ON"
  109.     NEXT i%
  110.     FOR i% = 1 TO 8 STEP 1
  111.     AddListItem STATUSTEXT$, ""
  112.     NEXT i%
  113.     FOR i% = 1 TO 7 STEP 1
  114.     AddListItem DRIVETEXT$, ""
  115.     NEXT i%
  116.     ReplaceListItem DRIVETEXT$, 7, DEST$
  117.  
  118.     ''Disk cost list symbols
  119.     PCDLABNEEDS$  = "PcdLabNeeds"
  120.     PCDMOSNEEDS$  = "PcdMosNeeds"
  121.     PCDAUDNEEDS$  = "PcdAudNeeds"
  122.     PCDSCRNEEDS$  = "PcdScrNeeds"
  123.     PCDWALNEEDS$  = "PcdWalNeeds"
  124.     EXTRACOSTS$ = "ExtraCosts"
  125.     BIGLIST$    = "BigList"
  126.     FOR i% = 1 TO 5 STEP 1
  127.     AddListItem BIGLIST$, ""
  128.     NEXT i%
  129.     FOR i% = 1 TO 26 STEP 1
  130.     AddListItem EXTRACOSTS$, "0"
  131.     NEXT i%
  132.  
  133.     ''File Option Variables
  134.     OPT1OPT$ = "1"
  135.     OPT2OPT$ = "1"
  136.     OPT3OPT$ = "1"
  137.     OPT4OPT$ = "1"
  138.  
  139.     RecalcPath
  140.     SetDriveStatus
  141.  
  142. '$IFDEF DEBUG
  143.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  144. '$ENDIF ''DEBUG
  145.  
  146.  
  147. WELCOME:
  148.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  149.     IF sz$ = "CONTINUE" THEN
  150.     UIPop 1
  151.     ELSE
  152.     GOSUB ASKQUIT
  153.     GOTO WELCOME
  154.     END IF
  155.  
  156.  
  157. CUSTINST:
  158.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  159.  
  160.     IF sz$ = "CONTINUE" THEN
  161.     ''Install only if it will fit.
  162.     FOR i% = 1 TO 5 STEP 1
  163.         IF GetListItem(BIGLIST$, i%) <> "" THEN
  164.         GOSUB TOOBIG
  165.         GOTO CUSTINST
  166.         END IF
  167.     NEXT i%
  168.     UIPop 1
  169.     GOTO INSTALL
  170.     ELSEIF sz$ = "PATH" THEN
  171.     GOTO GETPATH
  172.     ELSEIF sz$ = "CHK1" THEN
  173.     RecalcOptFiles PCDLABFILES
  174.     SetDriveStatus
  175.     GOTO CUSTINST
  176.     ELSEIF sz$ = "CHK2" THEN
  177.     RecalcOptFiles PCDMOSFILES
  178.     SetDriveStatus
  179.     GOTO CUSTINST
  180.     ELSEIF sz$ = "CHK3" THEN
  181.     RecalcOptFiles PCDAUDFILES
  182.     SetDriveStatus
  183.     GOTO CUSTINST
  184.     ELSEIF sz$ = "CHK4" THEN
  185.     RecalcOptFiles PCDSCRFILES
  186.     SetDriveStatus
  187.     GOTO CUSTINST
  188.     ELSEIF sz$ = "CHK5" THEN
  189.     RecalcOptFiles PCDWALFILES
  190.     SetDriveStatus
  191.     GOTO CUSTINST
  192.     ELSEIF sz$ = "BTN2" THEN
  193.     GOTO PCDMOSFILES
  194.     ELSEIF sz$ = "BTN3" THEN
  195.     GOTO PCDAUDFILES
  196.     ELSEIF sz$ = "BTN4" THEN
  197.     GOTO PCDSCRFILES
  198.     ELSEIF sz$ = "BTN5" THEN
  199.     GOTO PCDWALFILES
  200.     ELSEIF sz$ = "REACTIVATE" THEN
  201.     RecalcPath
  202.     SetDriveStatus
  203.     GOTO CUSTINST
  204.     ELSE
  205.     GOSUB ASKQUIT
  206.     GOTO CUSTINST
  207.     END IF
  208.  
  209.  
  210.  
  211. INSTALL:
  212.     ClearCopyList
  213.     AddOptFilesToCopyList PCDLABFILES
  214.     AddOptFilesToCopyList PCDMOSFILES
  215.     AddOptFilesToCopyList PCDAUDFILES
  216.     AddOptFilesToCopyList PCDSCRFILES
  217.     AddOptFilesToCopyList PCDWALFILES
  218.     CreateDir DEST$, cmoNone
  219.     
  220.     IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  221.      IF DoesIniKeyExist("WIN.INI", "PhotoCD Lab", "Dir") = 1 THEN
  222.          PcdDir$ = GetIniKeyString("WIN.INI", "PhotoCD Lab", "Dir")
  223.          IF DoesFileExist(PcdDir$ + "\PCDSCSI.EXE", femReadWrite) = 1 THEN
  224.          SetSymbolValue "ConfirmTextIn", PcdDir$
  225.          SetSymbolValue "EditFocus", "END"
  226.          sz$ = UIStartDlg(CUIDLL$, PCDSCSI, "FConfirmDlgProc", APPHELP, HELPPROC$)
  227.          IF sz$ = "BACK" THEN
  228.              UIPop 1
  229.              GOTO CUSTINST
  230.          ELSEIF sz$ = "CONTINUE" THEN
  231.              UIPop 1
  232.          END IF
  233.          END IF
  234.      END IF
  235.      IF PcdDir$ <> "" THEN
  236.          CreateIniKeyValue "WIN.INI", "PhotoCD Lab", "Dir", PcdDir$, cmoOverwrite
  237.      ELSE
  238.          CreateIniKeyValue "WIN.INI", "PhotoCD Lab", "Dir", DEST$ + "\PCDLAB", cmoOverwrite
  239.      END IF
  240.     END IF
  241.  
  242.     IF GetListItem(CHECKSTATES$, PCDMOSFILES) = "ON" THEN
  243.      IF MosFlag$ <> "" THEN
  244.          SetSymbolValue "ConfirmTextIn", MosDir$
  245.          SetSymbolValue "EditFocus", "END"
  246.          sz$ = UIStartDlg(CUIDLL$, MOSAIC, "FConfirmDlgProc", APPHELP, HELPPROC$)
  247.          IF sz$ = "BACK" THEN
  248.              UIPop 1
  249.              GOTO CUSTINST
  250.          ELSEIF sz$ = "CONTINUE" THEN
  251.              UIPop 1
  252.          END IF
  253.      ELSEIF MosFlag$ = "" AND MOSDIR$ <> "" THEN
  254.          '' Just sit there for now
  255.      ELSE
  256.          CreateIniKeyValue "WIN.INI", "CorelGraphics4", "Dir", DEST$ + "\MOSAIC\CONFIG", cmoOverwrite
  257.          CreateDir DEST$ + "\MOSAIC\CONFIG", cmoNone
  258.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "ProgramsDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  259.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "CustomDir", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  260.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "MosaicDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  261.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "FiltersDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  262.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "DataDir", DEST$ + "\MOSAIC\PROGRAMS\DATA", cmoOverwrite
  263.      END IF
  264.      END IF
  265.     
  266.     IF GetListItem(CHECKSTATES$, PCDAUDFILES) = "ON" THEN
  267.      IF DoesIniKeyExist("WIN.INI", "CorelSCSI", "CD-Audio") = 1 THEN
  268.          CDAudioDir$ = GetIniKeyString("WIN.INI", "CorelSCSI", "CD-Audio")
  269.          IF DoesFileExist(CDAudioDir$ + "\CD_AUDIO.EXE", femReadWrite) = 1 THEN
  270.          SetSymbolValue "ConfirmTextIn", CDAudioDir$
  271.          SetSymbolValue "EditFocus", "END"
  272.          sz$ = UIStartDlg(CUIDLL$, CDAUDIO, "FConfirmDlgProc", APPHELP, HELPPROC$)
  273.          IF sz$ = "BACK" THEN
  274.              UIPop 1
  275.              GOTO CUSTINST
  276.          ELSEIF sz$ = "CONTINUE" THEN
  277.              UIPop 1
  278.          END IF
  279.          END IF
  280.      END IF
  281.      CreateIniKeyValue "WIN.INI", "CorelSCSI", "CD-Audio", DEST$ + "\PCDAUDIO", cmoOverwrite
  282.     END IF
  283.  
  284.     
  285.     CopyFilesInCopyList
  286.  
  287.     InstDrive$=MID$(DEST$,1,2)
  288.     IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  289.     CreateProgmanGroup "Corel CD-ROM Utilities", "", cmoNone
  290.     ShowProgmanGroup  "Corel Cd-ROM Utilities", 1, cmoNone
  291.     CreateProgmanItem "Corel CD-ROM Utilities", "PhotoCD Lab", MakePath(DEST$, "pcdlab\pcdscsi.exe "), "", cmoOverwrite
  292.     END IF
  293.  
  294.     IF GetListItem(CHECKSTATES$, PCDMOSFILES) = "ON" THEN
  295.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  296.     IF MosDir$ <> "" THEN
  297.         CreateProgmanItem "Corel CD-ROM Utilities", "CorelMOSAIC!", MosDir$ + "\CORELMOS.EXE", "", cmoOverwrite
  298.     ELSE
  299.         CreateProgmanItem "Corel CD-ROM Utilities", "CorelMOSAIC!", MakePath(DEST$, "mosaic\programs\corelmos.exe "), "", cmoOverwrite
  300.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELFLT.INI", "ColorPath", "CircuitPath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  301.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELFLT.INI", "ColorPath", "CurvePath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  302.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELPRN.INI", "ColorPath", "CircuitPath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  303.     END IF
  304.     END IF
  305.  
  306.     IF GetListItem(CHECKSTATES$, PCDAUDFILES) = "ON" THEN
  307.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  308.     CreateProgmanItem "Corel CD-ROM Utilities", "CD Audio", MakePath(DEST$, "pcdaudio\cd_audio.exe "), "", cmoOverwrite
  309.     END IF
  310.  
  311.     IF GetListItem(CHECKSTATES$, PCDSCRFILES) = "ON" THEN
  312.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  313.     END IF
  314.  
  315.     IF GetListItem(CHECKSTATES$, PCDWALFILES) = "ON" THEN
  316.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  317.     CreateProgmanItem "Corel CD-ROM Utilities", "Wallpaper Flipper Configuration", MakePath(GetWindowsDir, "wflipcnf.exe"), "", cmoOverwrite
  318.     END IF
  319.  
  320.     CreateProgmanItem "Corel CD-ROM Utilities", "Professional Photos ReadMe", "notepad.exe "+MakePath(DEST$,"readme.txt"), "", cmoOverwrite 
  321.  
  322. QUIT:
  323.     ON ERROR GOTO ERRQUIT
  324.  
  325.     IF ERR = 0 THEN
  326.     dlg% = EXITSUCCESS
  327.     ELSEIF ERR = STFQUIT THEN
  328.     dlg% = EXITQUIT
  329.     ELSE
  330.     dlg% = EXITFAILURE
  331.     END IF
  332. QUITL1:
  333.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  334.     IF sz$ = "REACTIVATE" THEN
  335.     GOTO QUITL1
  336.     END IF
  337.     UIPop 1
  338.  
  339.     END
  340.  
  341. ERRQUIT:
  342.     i% = DoMsgBox("Setup sources were corrupted, call Corel Tech Support", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  343.     END
  344.  
  345.  
  346.  
  347. GETPATH:
  348.     SetSymbolValue "EditTextIn", DEST$
  349.     SetSymbolValue "EditFocus", "END"
  350. GETPATHL1:
  351.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  352.  
  353.     IF sz$ = "CONTINUE" THEN
  354.     olddest$ = DEST$
  355.     DEST$ = GetSymbolValue("EditTextOut")
  356.  
  357.     ''Validate new path.
  358.     IF IsDirWritable(DEST$) = 0 THEN
  359.         GOSUB BADPATH
  360.         GOTO GETPATHL1
  361.     END IF
  362.     UIPop 1
  363.  
  364.     ''Truncate display if too long.
  365.     IF LEN(DEST$) > 23 THEN
  366.         ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  367.     ELSE
  368.         ReplaceListItem DRIVETEXT$, 7, DEST$
  369.     END IF
  370.  
  371.     ''Recalc if path changed.
  372.     IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  373.         RecalcPath
  374.         SetDriveStatus
  375.     END IF
  376.  
  377.     olddest$ = ""
  378.     GOTO CUSTINST
  379.     ELSEIF sz$ = "REACTIVATE" THEN
  380.     RecalcPath
  381.     SetDriveStatus
  382.     GOTO GETPATHL1
  383.     ELSEIF sz$ = "EXIT" THEN
  384.     GOSUB ASKQUIT
  385.     GOTO GETPATHL1
  386.     ELSE
  387.     UIPop 1
  388.     GOTO CUSTINST
  389.     END IF
  390.  
  391.  
  392.  
  393. PCDMOSFILES:
  394.     SetSymbolValue "RadioDefault", OPT1OPT$
  395. OPT1L1:
  396.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  397.     newopt$ = GetSymbolValue("ButtonChecked")
  398.  
  399.     IF sz$ = "CONTINUE" THEN
  400.     UIPop 1
  401.     IF newopt$ <> OPT1OPT$ THEN
  402.         OPT1OPT$ = newopt$
  403.         RecalcOptFiles PCDMOSFILES
  404.         SetDriveStatus
  405.     END IF
  406.     newopt$ = ""
  407.     GOTO CUSTINST
  408.     ELSEIF sz$ = "REACTIVATE" THEN
  409.     RecalcPath
  410.     SetDriveStatus
  411.     GOTO OPT1L1
  412.     ELSEIF sz$ = "EXIT" THEN
  413.     GOSUB ASKQUIT
  414.     GOTO OPT1L1
  415.     ELSE
  416.     UIPop 1
  417.     newopt$ = ""
  418.     GOTO CUSTINST
  419.     END IF
  420.  
  421.  
  422.  
  423. PCDAUDFILES:
  424.     SetSymbolValue "RadioDefault", OPT2OPT$
  425. OPT2L1:
  426.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  427.     newopt$ = GetSymbolValue("ButtonChecked")
  428.  
  429.     IF sz$ = "CONTINUE" THEN
  430.     UIPop 1
  431.     IF newopt$ <> OPT2OPT$ THEN
  432.         OPT2OPT$ = newopt$
  433.         RecalcOptFiles PCDAUDFILES
  434.         SetDriveStatus
  435.     END IF
  436.     newopt$ = ""
  437.     GOTO CUSTINST
  438.     ELSEIF sz$ = "REACTIVATE" THEN
  439.     RecalcPath
  440.     SetDriveStatus
  441.     GOTO OPT2L1
  442.     ELSEIF sz$ = "EXIT" THEN
  443.     GOSUB ASKQUIT
  444.     GOTO OPT2L1
  445.     ELSE
  446.     UIPop 1
  447.     newopt$ = ""
  448.     GOTO CUSTINST
  449.     END IF
  450.  
  451.  
  452.  
  453. PCDSCRFILES:
  454.     SetSymbolValue "RadioDefault", OPT3OPT$
  455. OPT3L1:
  456.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  457.     newopt$ = GetSymbolValue("ButtonChecked")
  458.  
  459.     IF sz$ = "CONTINUE" THEN
  460.     UIPop 1
  461.     IF newopt$ <> OPT1OPT$ THEN
  462.         OPT3OPT$ = newopt$
  463.         RecalcOptFiles PCDSCRFILES
  464.         SetDriveStatus
  465.     END IF
  466.     newopt$ = ""
  467.     GOTO CUSTINST
  468.     ELSEIF sz$ = "REACTIVATE" THEN
  469.     RecalcPath
  470.     SetDriveStatus
  471.     GOTO OPT3L1
  472.     ELSEIF sz$ = "EXIT" THEN
  473.     GOSUB ASKQUIT
  474.     GOTO OPT3L1
  475.     ELSE
  476.     UIPop 1
  477.     newopt$ = ""
  478.     GOTO CUSTINST
  479.     END IF
  480.  
  481.  
  482.  
  483. PCDWALFILES:
  484.     SetSymbolValue "RadioDefault", OPT4OPT$
  485. OPT4L1:
  486.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  487.     newopt$ = GetSymbolValue("ButtonChecked")
  488.  
  489.     IF sz$ = "CONTINUE" THEN
  490.     UIPop 1
  491.     IF newopt$ <> OPT4OPT$ THEN
  492.         OPT4OPT$ = newopt$
  493.         RecalcOptFiles PCDWALFILES
  494.         SetDriveStatus
  495.     END IF
  496.     newopt$ = ""
  497.     GOTO CUSTINST
  498.     ELSEIF sz$ = "REACTIVATE" THEN
  499.     RecalcPath
  500.     SetDriveStatus
  501.     GOTO OPT4L1
  502.     ELSEIF sz$ = "EXIT" THEN
  503.     GOSUB ASKQUIT
  504.     GOTO OPT4L1
  505.     ELSE
  506.     UIPop 1
  507.     newopt$ = ""
  508.     GOTO CUSTINST
  509.     END IF
  510.  
  511.  
  512.  
  513. TOOBIG:
  514.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  515.     IF sz$ = "REACTIVATE" THEN
  516.     RecalcPath
  517.     SetDriveStatus
  518.     GOTO TOOBIG
  519.     END IF
  520.     UIPop 1
  521.     RETURN
  522.  
  523.  
  524.  
  525. BADPATH:
  526.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  527.     IF sz$ = "REACTIVATE" THEN
  528.     RecalcPath
  529.     SetDriveStatus
  530.     GOTO BADPATH
  531.     END IF
  532.     UIPop 1
  533.     RETURN
  534.  
  535.  
  536.  
  537. ASKQUIT:
  538.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  539.  
  540.     IF sz$ = "EXIT" THEN
  541.     UIPopAll
  542.     ERROR STFQUIT
  543.     ELSEIF sz$ = "REACTIVATE" THEN
  544.     GOTO ASKQUIT
  545.     ELSE
  546.     UIPop 1
  547.     END IF
  548.     RETURN
  549.  
  550.  
  551.  
  552. '**
  553. '** Purpose:
  554. '**     Adds the specified option files to the copy list.
  555. '** Arguments:
  556. '**     ftype%  - type of files to add, one of the following:
  557. '**             PCDLABFILES, PCDAUDFILES, PCDMOSFILES, PCDSCRFILES, PCDWALFILES
  558. '** Returns:
  559. '**     none.
  560. '*************************************************************************
  561. SUB AddOptFilesToCopyList (ftype%) STATIC
  562.  
  563.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  564.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  565.     WinDirLen = LEN(GetWindowsDir)-1
  566.     WinDir$ = MID$(GetWindowsDir,1,WinDirLen)
  567.     InstDrive$ = MID$(DEST$,1,2)
  568.     IF ftype% = PCDLABFILES THEN
  569.         AddSectionFilesToCopyList "PcdLabFiles", SrcDir$, DEST$ + "\PCDLAB"
  570.         FLAG1$="Yes"
  571.         FLAG2$="Yes"
  572.         FLAG3$="Yes"
  573.     ELSEIF ftype% = PCDMOSFILES THEN
  574.      IF DoesIniKeyExist("WIN.INI", "CorelGraphics4", "Dir") = 1 THEN
  575.          CorelAppDir$ = GetIniKeyString("WIN.INI", "CorelGraphics4", "Dir")
  576.          MosDir$ = GetIniKeyString(CorelAppDir$ + "\CORELAPP.INI", "Config", "ProgramsDir")
  577.          IF MosDir$ <> "" AND DoesFileExist(MosDir$ + "\CORELMOS.EXE", femReadWrite) = 1 THEN
  578.            MosFlag$ = "Yes"
  579.            ELSE
  580.            MosFlag$ = ""
  581.          END IF 
  582.            AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, MosDir$
  583.            AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, MosDir$
  584.      ELSE 
  585.           AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS"
  586.           AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, DEST$ + "\MOSAIC\CUSTOM"
  587.           AddSectionFilesToCopyList "PcdMosInis", SrcDir$, DEST$ + "\MOSAIC\CONFIG"
  588.           AddSectionFilesToCopyList "PcdMosData", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS\DATA"
  589.      END IF
  590.         FLAG1$="Yes"
  591.         FLAG3$="Yes"
  592.     ELSEIF ftype% = PCDAUDFILES THEN
  593.         AddSectionFilesToCopyList "PcdAudFiles", SrcDir$, DEST$ + "\PCDAUDIO"
  594.     ELSEIF ftype% = PCDSCRFILES THEN
  595.         AddSectionFilesToCopyList "PcdScrFiles", SrcDir$, GetWindowsDir
  596.         FLAG3$="Yes"
  597.     ELSEIF ftype% = PCDWALFILES THEN
  598.         AddSectionFilesToCopyList "PcdWalFiles", SrcDir$, GetWindowsDir
  599.     END IF
  600.     IF FLAG1$="Yes" THEN
  601.         CreateIniKeyValue "WIN.INI", "Extensions", "PCD", DEST$ + "\PCDLAB\PCDSCSI.EXE ^.PCD", cmoNone
  602.         AddSectionFilesToCopyList "PcdDllFiles", SrcDir$, GetWindowsSysDir
  603.         IF DoesFileExist(GetWindowsDir + "PCDLIB.DLL", femReadWrite) =1 THEN
  604.         RemoveFile GetWindowsDir + "PCDLIB.DLL", cmoNone
  605.         END IF
  606.         IF DoesFileExist(GetWindowsDir + "PCDXTIF.DLL", femReadWrite) =1 THEN
  607.         RemoveFile GetWindowsDir + "PCDXTIF.DLL", cmoNone
  608.         END IF
  609.         IF DoesFileExist(GetWindowsDir + "PCDXEPS.DLL", femReadWrite) =1 THEN
  610.         RemoveFile GetWindowsDir + "PCDXEPS.DLL", cmoNone
  611.         END IF
  612.         IF DoesFileExist(GetWindowsDir + "PCDXPCX.DLL", femReadWrite) =1 THEN
  613.         RemoveFile GetWindowsDir + "PCDXPCX.DLL", cmoNone
  614.         END IF
  615.         IF DoesFileExist(GetWindowsDir + "PCDXBMP.DLL", femReadWrite) =1 THEN
  616.         RemoveFile GetWindowsDir + "PCDXBMP.DLL", cmoNone
  617.         END IF
  618.     END IF
  619.     IF FLAG2$="Yes" THEN
  620.         AddSectionFilesToCopyList "PcdCtlFile", SrcDir$, GetWindowsSysDir
  621.     END IF
  622.     IF FLAG3$="Yes" THEN
  623.         AddSectionFilesToCopyList "PcdDllFile", SrcDir$, GetWindowsSysDir
  624.     END IF
  625.         AddSectionFilesToCopyList "PcdReadMe", SrcDir$, DEST$
  626.     FLAG1$="No"
  627.     FLAG2$="No"
  628.     FLAG3$="No"
  629.     SrcDir$ = ""
  630.     END IF
  631. END SUB
  632.  
  633. '**
  634. '** Purpose:
  635. '**     Recalculates disk space for the given option files and sets
  636. '**     the status info symbol "StatusItemsText".
  637. '** Arguments:
  638. '**     ftype% - type of files to add, one of the following:
  639. '**             PCDLABFILES, PCDMOSFILES, PCDAUDFILES, PCDSCRFILES, PCDWALFILES
  640. '** Returns:
  641. '**     none.
  642. '*************************************************************************
  643. SUB RecalcOptFiles (ftype%) STATIC
  644.     CursorSave% = ShowWaitCursor()
  645.     ClearCopyList
  646.     AddOptFilesToCopyList ftype%
  647.  
  648.     fExtra% = 0
  649.     IF ftype% = PCDLABFILES THEN
  650.     ListSym$ = PCDLABNEEDS$
  651.        IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  652.        ''Add extra cost to Windows drive for ini/progman, etc.
  653.        ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  654.        ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  655.        fExtra% = 1
  656.        END IF
  657.     ELSEIF ftype% = PCDMOSFILES THEN
  658.     ListSym$ = PCDMOSNEEDS$
  659.     ELSEIF ftype% = PCDAUDFILES THEN
  660.     ListSym$ = PCDAUDNEEDS$
  661.     ELSEIF ftype% = PCDSCRFILES THEN
  662.     ListSym$ = PCDSCRNEEDS$
  663.     ELSEIF ftype% = PCDWALFILES THEN
  664.     ListSym$ = PCDWALNEEDS$
  665.     END IF
  666.  
  667.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  668.  
  669.     cost& = 0
  670.     FOR i% = 1 TO 26 STEP 1
  671.     cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  672.     NEXT i%
  673.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  674.  
  675.     IF StillNeed& > 0 THEN
  676.     ReplaceListItem BIGLIST$, ftype%, "YES"
  677.     ELSE
  678.     ReplaceListItem BIGLIST$, ftype%, ""
  679.     END IF
  680.  
  681. '    IF fExtra% THEN
  682. '        ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  683. '    END IF
  684.     RestoreCursor CursorSave%
  685.     ListSym$ = ""
  686. END SUB
  687.  
  688.  
  689. '**
  690. '** Purpose:
  691. '**     Recalculates disk space and sets option status info according
  692. '**     to the current destination path.
  693. '** Arguments:
  694. '**     none.
  695. '** Returns:
  696. '**     none.
  697. '*************************************************************************
  698. SUB RecalcPath STATIC
  699.  
  700.     CursorSave% = ShowWaitCursor()
  701.  
  702.     RecalcOptFiles PCDLABFILES
  703.     RecalcOptFiles PCDMOSFILES
  704.     RecalcOptFiles PCDAUDFILES
  705.     RecalcOptFiles PCDSCRFILES
  706.     RecalcOptFiles PCDWALFILES
  707.  
  708.     RestoreCursor CursorSave%
  709. END SUB
  710.  
  711.  
  712. '**
  713. '** Purpose:
  714. '**     Sets drive status info according to latest disk space calcs.
  715. '** Arguments:
  716. '**     none.
  717. '** Returns:
  718. '**     none.
  719. '*************************************************************************
  720. SUB SetDriveStatus STATIC
  721.  
  722.     drive$ = MID$(DEST$, 1, 1)
  723.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  724.     cost& = VAL(GetListItem(PCDLABNEEDS$, ndrive%)) + VAL(GetListItem(PCDMOSNEEDS$, ndrive%)) + VAL(GetListItem(PCDAUDNEEDS$, ndrive%)) + VAL(GetListItem(PCDSCRNEEDS$, ndrive%)) + VAL(GetListItem(PCDWALNEEDS$, ndrive%))
  725.     free& = GetFreeSpaceForDrive(drive$)
  726.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  727.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  728.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  729.  
  730.     IF drive$ = WINDRIVE$ THEN
  731.     ReplaceListItem DRIVETEXT$, 4, ""
  732.     ReplaceListItem DRIVETEXT$, 5, ""
  733.     ReplaceListItem DRIVETEXT$, 6, ""
  734.     ELSE
  735.     ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  736.     cost& = VAL(GetListItem(PCDLABNEEDS$, ndrive%)) + VAL(GetListItem(PCDMOSNEEDS$, ndrive%)) + VAL(GetListItem(PCDAUDNEEDS$, ndrive%)) + VAL(GetListItem(PCDSCRNEEDS$, ndrive%)) + VAL(GetListItem(PCDWALNEEDS$, ndrive%))
  737.     IF cost& = 0 THEN
  738.         ReplaceListItem DRIVETEXT$, 4, ""
  739.         ReplaceListItem DRIVETEXT$, 5, ""
  740.         ReplaceListItem DRIVETEXT$, 6, ""
  741.     ELSE
  742.         free& = GetFreeSpaceForDrive(WINDRIVE$)
  743.         ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  744.         ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  745.         ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  746.     END IF
  747.     END IF
  748. END SUB
  749.  
  750.  
  751. '**
  752. '** Purpose:
  753. '**     Appends a file name to the end of a directory path,
  754. '**     inserting a backslash character as needed.
  755. '** Arguments:
  756. '**     szDir$  - full directory path (with optional ending "\")
  757. '**     szFile$ - filename to append to directory
  758. '** Returns:
  759. '**     Resulting fully qualified path name.
  760. '*************************************************************************
  761. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  762.     IF szDir$ = "" THEN
  763.     MakePath = szFile$
  764.     ELSEIF szFile$ = "" THEN
  765.     MakePath = szDir$
  766.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  767.     MakePath = szDir$ + szFile$
  768.     ELSE
  769.     MakePath = szDir$ + "\" + szFile$
  770.     END IF
  771. END FUNCTION
  772.  
  773.